package com.mcx.modules.data.localdata.create;

import com.mcx.modules.data.GameDataTableParser;
import com.mcx.modules.data.base.AbstractDBModel;

/** WorldMapMonster数据管理 */
public class WorldMapMonsterDBModel extends AbstractDBModel<WorldMapMonsterDBModel, WorldMapMonsterEntity>
{
    private static WorldMapMonsterDBModel instance;

    public static WorldMapMonsterDBModel getInstance() {
        if (instance == null) {
            instance = new WorldMapMonsterDBModel();
        }
        return instance;
    }

    /** 文件名称 */
    @Override
    protected String FileName() {
        return "WorldMapMonster.data";
    }

    /** 创建实体 */
    @Override
    protected WorldMapMonsterEntity MakeEntity(GameDataTableParser parse)
    {
        WorldMapMonsterEntity entity = new WorldMapMonsterEntity();
        entity.Id = parse.GetFieldValueToInt("Id");
        entity.WorldMapId = parse.GetFieldValueToInt("WorldMapId");
        entity.Grade = parse.GetFieldValueToInt("Grade");
        entity.Region = parse.GetFieldValueToUTF8String("Region");
        entity.MonsterId = parse.GetFieldValueToInt("MonsterId");
        entity.MonsterCount = parse.GetFieldValueToInt("MonsterCount");
        entity.Exp = parse.GetFieldValueToInt("Exp");
        entity.Gold = parse.GetFieldValueToInt("Gold");
        entity.DropEquip = parse.GetFieldValueToUTF8String("DropEquip");
        entity.DropItem = parse.GetFieldValueToUTF8String("DropItem");
        entity.DropMaterial = parse.GetFieldValueToUTF8String("DropMaterial");
        return entity;
    }
}
